-- 房间ID
local roomId = KEYS[1]
-- 房间不存在
if redis.call('exists', 'wooha-cache-hub:room:info:' .. roomId) == 0 then
    return {1, "房间不存在"}
end
-- 房间信息
local roomInfo = cjson.decode(redis.call('get', 'wooha-cache-hub:room:info:' .. roomId))
-- 团购ID
local groupBuyingId
-- 队列列表不存在
if redis.call('exists', 'wooha-cache-hub:room:queue:' .. roomId) == 0 then
    return {1, "队列列表不存在"}
end
-- 队列列表
local queueList = cjson.decode(redis.call('get', 'wooha-cache-hub:room:queue:' .. roomId))
for index, queue in ipairs(queueList) do
    if queue['id'] == roomInfo['queueId'] then
        groupBuyingId = queue['groupBuyingId']
        break
    end
end
-- 团购不存在
if groupBuyingId == nil then
    return {1, "团购不存在"}
end
-- 房间投票不存在
if redis.call('exists', 'wooha-cache-hub:room:vote:' .. groupBuyingId) == 0 then
    return {1, "房间投票不存在"}
end
-- 房间投票
local roomVote = redis.call('get', 'wooha-cache-hub:room:vote:' .. groupBuyingId)
return {0, roomVote}
